package com.llf.Blog.ServiceImpl;

import com.llf.Blog.Pojo.Type;
import com.llf.Blog.Mapper.TypeMapper;
import com.llf.Blog.Service.TypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author llf
 * @since 2021-08-07
 */
@Transactional(rollbackFor=Exception.class)
@Service
public class TypeServiceImpl extends ServiceImpl<TypeMapper, Type> implements TypeService {

    @Autowired
    private TypeMapper typeMapper;


    @Override
    public Type getById(Long id) {
        return typeMapper.getById(id);
    }

    @Override
    public List<Type> getAll() {
        return typeMapper.getAll();
    }

    @Override
    public Boolean insertType(Type type) {
        return typeMapper.insertType(type);
    }

    @Override
    public Boolean update(Type type) {
        return typeMapper.update(type);
    }

    @Override
    public Boolean deleteById(long id) {
        return typeMapper.deleteById(id);
    }

    @Override
    public Type getByName(String name) {
        return typeMapper.getByName(name);
    }

    @Override
    public List<Type> getCountType() {
        return typeMapper.getCountType();
    }


}
